import { computed } from 'vue'
import { PC_DIVICE_WIDTH } from '../constants/index.js'
import { useWindowSize } from '@vueuse/core'
const { width } = useWindowSize()
export const isMobileTerminal = computed(() => {
  return width.value < PC_DIVICE_WIDTH
})
// 校准
export const useRem = () => {
  const MAX_FONT_SIZE = 40
  document.addEventListener('DOMContentLoaded', () => {
    const html = document.querySelector('html')
    const fontSize = window.innerWidth / 10
    html.style.fontSize =
      fontSize > MAX_FONT_SIZE ? MAX_FONT_SIZE + 'px' : fontSize + 'px'
  })
}
